#ifndef ITEM_HPP
#define ITEM_HPP

#include "Creature.hpp"
#include "Entity.hpp"
#include "../Animation.hpp"
#include "../../FileParser.hpp"

enum ItemFlag
{
	ITEM_HOSTILE,
	ITEM_BANANA,
	ITEM_ONLY_CHARACTER,
	ITEM_ONLY_MONSTER,
	ITEM_LIFE
};

class Item : public Entity
{
public:
	Item(App* appPtr);
    // Constructor copy
    Item(Item const& item);

    // Return true if the item can be taken
	bool CanBeTaken();

	// Return true if the item is currently taken by a creature
	bool IsTaken();

	// Return the creature who has currently the item
    Creature* Owner();

	// Set an booleen if the item can be taken
    void SetCanBeTaken(bool canBeTaken);

	// Set an booleen if the item is taken
	void SetIsTaken(bool isTaken);

	// Set the new creature who will take the item
    void SetOwner(Creature* creature = 0);

	// Set an pointer to Animation
    void SetAnimation(Animation* anim);

	// Get an pointer to Animation
    Animation* GetAnimation() const;

	// Load Script
	virtual void LoadScript(const std::string &filename);

	// Add Flag
	void AddFlag(ItemFlag flag);

	// Remove Flag
	void RemoveFlag(ItemFlag flag);

	// Return a booleen if find the flag given
	bool FindFlag(ItemFlag flag);

private:
	// Item can be taken ?
	bool m_canBeTaken;

	// Item is taken by a Creature ?
	bool m_isTaken;

	// Return a pointer to owner's Item ( pointer to Creature  )
	Creature *m_owner;

	// Item Animation
	Animation* m_anim;

	// Item Flags
	std::list<ItemFlag> m_flags;

};

#endif

